home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_112_UI Radio Group Item.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  2.0 KB  |  63 lines

  1. property GroupName, GroupSetting, selectedButton, default
  2.  
  3. on mouseUp me
  4.   setGroupValue(me)
  5. end
  6.  
  7. on beginSprite me
  8.   if default = 1 then
  9.     sendAllSprites(#clearGroup, GroupName)
  10.     set selectedButton to the spriteNum of me
  11.     setGroupValue(me)
  12.   else
  13.     sendAllSprites(#clearGroup, GroupName)
  14.   end if
  15. end
  16.  
  17. on getValue me, GName
  18.   if GName = the GroupName of me then
  19.     dontPassEvent()
  20.     return the text of member the member of sprite the selectedButton of me
  21.   end if
  22. end
  23.  
  24. on setValue me, GName, selected_sprite_num
  25.   set MNum to the member of sprite the spriteNum of me
  26.   if GName = the GroupName of me then
  27.     set the hilite of member MNum to 0
  28.     set the selectedButton of me to selected_sprite_num
  29.   end if
  30. end
  31.  
  32. on setGroupValue me
  33.   sendAllSprites(#setValue, the GroupName of me, the spriteNum of me)
  34.   if the type of member the memberNum of sprite the spriteNum of me = #button then
  35.     set the hilite of member the member of sprite the spriteNum of me to 1
  36.   else
  37.     setValue(me, 1)
  38.   end if
  39. end
  40.  
  41. on clearGroup me, GName
  42.   if GName = the GroupName of me then
  43.     if default = 0 then
  44.       set the hilite of member the member of sprite the spriteNum of me to 0
  45.     else
  46.       set the hilite of member the member of sprite the spriteNum of me to 1
  47.     end if
  48.   end if
  49. end
  50.  
  51. on getPropertyDescriptionList
  52.   return [#GroupName: [#default: #group1, #format: #symbol, #comment: "Group Name"], #default: [#default: 0, #format: #boolean, #comment: "Initially Selected?"]]
  53. end
  54.  
  55. on getBehaviorDescription
  56.   return "Add system button to radio button group." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Group Name: Set the name of the group that this radio button belongs to.  Only one member of the group will be selected." & RETURN & "ΓÇó┬áInitially Selected: If Initially Selected is checked, then this radio button will be selected on beginSprite.  If more than one radio button has Initially Selected checked the highest numbered sprite will be selected. "
  57. end
  58.  
  59. on getAssocMembers
  60.   set myPropList to []
  61.   return myPropList
  62. end
  63.